<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取数据类型</title>
</head>
<body>
    <script>
        const getType = v => v === undefined ? 'undefined' : v === null ? 'null' : v.constructor.name;
        const dataTypes = [1,[],{},false,undefined,null,Symbol(),'test',new Set([]),new Map(),new Date(),() => {}].map(item => getType(item));
        document.write(dataTypes.join(','))
    </script>
</body>
</html>